package com.simplegui.examples.pong;

import static com.simplegui.examples.pong.PongConfigurations.FRAME_WIDTH;
import static com.simplegui.examples.pong.PongConfigurations.font;

import java.awt.Color;
import java.awt.Point;

import com.simplegui.api.Canvas;
import com.simplegui.api.GameComponent;

public class PongScore implements GameComponent{
	
	private int score1;
	private int score2;
	
	public PongScore() {
		resetScore();
	}

	public void resetScore() {
		score1 = 0;
		score2 = 0;
	}
	
	public int getScore1() {
		return score1;
	}
	
	public int getScore2() {
		return score2;
	}
	
	public void incrementScore1(){
		score1++;
	}
	
	public void incrementScore2(){
		score2++;
	}

	@Override
	public void executeLogic() {}

	@Override
	public void draw(Canvas c) {
		c.drawText(new Integer(getScore1()).toString(), new Point(FRAME_WIDTH / 4, 50), font, Color.BLUE);
		c.drawText(new Integer(getScore2()).toString(), new Point(FRAME_WIDTH / 4 * 3, 50), font, Color.RED);
	}

	@Override
	public Point getPosition() {
		return null;
	}

	@Override
	public double getRadius() {
		return 0;
	}

}
